<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
     xmlns:a="http://xmlns.jcp.org/jsf/passthrough"
     template="../TemplateFrontEnd.xhtml">
<ui:define name="title">Register Now</ui:define>
<ui:define name="body" >
<script>
	function ChangeVisibility()
	{
		
		 if(document.getElementById('j_idt16:j_idt17:UserType_input').value=="Permanent")
			 {
			 
			 document.getElementById('j_idt16:j_idt17:lobjet').style.display = 'block';
			 }
		 else
			 {
			 document.getElementById('j_idt16:j_idt17:lobjet').style.display = 'none';
			 }
	}
	

</script>



<div class="container">


  <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
     
	   
    <p:panel id="basic"   > 
    <h:form>
               <h:panelGrid columns="4" cellpadding="5" style="width:41%;clear: both;margin: auto;">
               <p:commandLink style="color:blue;" ajax="false" value="Proffessional carrier" action="#" />
	   <p:commandLink style="color:blue;" ajax="false" value="Private carrier" action="RegisterPriCarrier.xhtml" />
	   <p:commandLink style="color:blue;" ajax="false" value="Proffessional shipper" action="RegisterProShipper.xhtml" />
	   <p:commandLink style="color:blue;" ajax="false" value="Private shipper" action="RegisterPriShipper.xhtml" />
         </h:panelGrid> 
         </h:form>
         <h:form>
           <h:panelGrid columns="1" cellpadding="5" style="width:41%;clear: both;margin: auto;">

        <p:outputLabel value="Are you a Carrier, Register Now?" />
        <p:outputLabel  value="Company Details" />
        
        <p:inputText id="CompanyName" value="#{inscriptionMB.client.nom_Societe}" />
         <p:watermark for="CompanyName" value="Company Name"  />
         
         
        <p:inputTextarea id="CompanyDetails"  value="#{inscriptionMB.client.details_Societe}" />
         <p:watermark  for="CompanyDetails" value="Company Details"  />
       
        <p:selectCheckboxMenu  id="tr" label="Select Transport Category" value="#{inscriptionMB.listeTransport}"   filter="true" filterMatchMode="startsWith" panelStyle="width:250px"  > 
        <p:ajax listener="#{inscriptionMB.onChangeListTransport()}" update="TransportCat" />
         <f:selectItems value="#{inscriptionMB.listTransport()}" var="a" itemValue="#{a.idTransport}" itemLabel="#{a.intitule}" />
        </p:selectCheckboxMenu>
        
    
      <p:selectCheckboxMenu label="Select Transport Type" id="TransportCat" value="#{inscriptionMB.listIdentifiantTransCat}"
                              filter="true" filterMatchMode="startsWith" panelStyle="width:250px"  >
            <f:selectItems value="#{inscriptionMB.listTransportCat}" var="a" itemValue="#{a.idTransportCat}" itemLabel="#{a.intitule}" />
      </p:selectCheckboxMenu>
         
          
		  <p:selectOneMenu  id="Industry" value="#{inscriptionMB.idIndustry}" style="width:150px"  >
                <f:selectItem itemLabel="Industry Type" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listeIndustrie()}" var="a" itemValue="#{a.idIndustrie}" itemLabel="#{a.intitule}" />
            </p:selectOneMenu>
      
      
      
       
	   <p:selectOneMenu id="typeServ" value="#{inscriptionMB.client.serviceType}" style="width:150px"  >
               <f:selectItem itemLabel="Market Coverage" itemValue="" noSelectionOption="true" />
               <f:selectItem itemLabel="Local" itemValue="Local" />
               <f:selectItem itemLabel="National" itemValue="National" />
                <f:selectItem itemLabel="International" itemValue="International" />
        </p:selectOneMenu>
 
            
	   <p:selectOneMenu id="countryc" value="#{inscriptionMB.idCcm}" style="width:150px"   >
                <p:ajax listener="#{inscriptionMB.onCountryChange(1)}" update="Statec" />
                <f:selectItem itemLabel="Country" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listPays}" var="a" itemValue="#{a.idPays}" itemLabel="#{a.intitule}" />
            </p:selectOneMenu>
           
	
	 
	  <p:selectOneMenu id="Statec" value="#{inscriptionMB.idScm}" style="width:150px"  >
               <p:ajax listener="#{inscriptionMB.onStateChange(1)}" update="cityc" />
                 <f:selectItem itemLabel="State" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listeEtatcm}"  var="s" itemValue="#{s.idEtat}"  itemLabel="#{s.intitule}"/>
            </p:selectOneMenu>
          
            
		
		  <p:selectOneMenu id="cityc" value="#{inscriptionMB.idCicm}" style="width:150px"  >
                <f:selectItem itemLabel="City" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listeVillecm}" var="a" itemValue="#{a.idVille}" itemLabel="#{a.intitule}" />
            </p:selectOneMenu>
              
	
	 
	  <p:inputText id="zipcodeC" value="#{inscriptionMB.client.codePost_Societe}" />
	  <p:watermark for="zipcodeC" value="Zipcode"  />
	

		<p:inputText p:placeholder="Street Address" id="StreetC" value="#{inscriptionMB.client.rue_Societe}" />
		<p:watermark for="StreetC" value="Street Address"  />
		
		
		

		<p:inputText  id="TelephoneC" value="#{inscriptionMB.client.telephone_societe}" />
		<p:watermark for="TelephoneC" value="Telephone"  />
		
		
		
		<p:inputText  id="fax" value="#{inscriptionMB.client.fax}" />
		<p:watermark for="fax" value="Fax"  />
	
	

		<p:inputText  id="ORG" value="#{inscriptionMB.client.organization_Number}" />
		<p:watermark for="ORG" value="Business Organisation Number"  />

       <p:outputLabel value="Global Location Number" />
	   <p:inputText   id="GLN" value="#{inscriptionMB.listgln[0]}" />
		<p:watermark for="GLN" value="GLN (Global Location Number)"  />
		
		

		<p:calendar id="gle" value="#{inscriptionMB.listeExpgln[0]}" />
		<p:watermark for="gle" value="GLN Expiry date"  />
		
	  <p:outputLabel value="Insurance" />
		<p:inputText id="AS" value="#{inscriptionMB.client.assurance_Societe}" />
		<p:watermark for="AS" value="Insurance Company"  />
		
		
		
		<p:inputText id="IA" value="#{inscriptionMB.client.assurance_Adresse}" />
		<p:watermark for="IA" value="Insurance Address"  />
		
		
	
		<p:inputText   id="IPN" value="#{inscriptionMB.client.assurance_Policy_Number}" />
		<p:watermark for="IPN" value="Insurance Policy Number"  />
		
	
		<p:inputText  id="IAM" value="#{inscriptionMB.client.assurance_montant}" />
		<p:watermark for="IAM" value="Insurance Amount"  />
	
		
		<p:inputText  id="ICP" value="#{inscriptionMB.client.assurance_Contact_phone}" />
		<p:watermark for="ICP" value="Insurance Contact Person"  />
		
		
		
		
		<p:calendar  id="IED" value="#{inscriptionMB.client.asssurance_Expiration}" />
		<p:watermark for="IED" value="Insurance Expiry Date"  />
		
		
		
		<p:outputLabel value="Postal Address:"   />
		

	
	   <p:selectOneMenu id="countryp" value="#{inscriptionMB.idCp}" style="width:150px"   >
                <p:ajax listener="#{inscriptionMB.onCountryChange(2)}" update="Statep" />
                <f:selectItem itemLabel="Country" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listPays}" var="a" itemValue="#{a.idPays}" itemLabel="#{a.intitule}" />
            </p:selectOneMenu>
          
	 
	  <p:selectOneMenu id="Statep" value="#{inscriptionMB.idSp}" style="width:150px"  >
               <p:ajax listener="#{inscriptionMB.onStateChange(2)}" update="cityp" />
                 <f:selectItem itemLabel="State" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listeEtatp}"  var="s" itemValue="#{s.idEtat}"  itemLabel="#{s.intitule}"/>
            </p:selectOneMenu>
           
            
            
		  <p:selectOneMenu id="cityp" value="#{inscriptionMB.idCip}" style="width:150px"   >
                <f:selectItem itemLabel="City" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listeVillep}" var="a" itemValue="#{a.idVille}" itemLabel="#{a.intitule}" />
            </p:selectOneMenu>
            
		
		
		 
	  <p:inputText  id="zipcodeP" value="#{inscriptionMB.client.codePost_Postal}" />
	  <p:watermark for="zipcodeP" value="Zipcode"  />
	
	
		<p:inputText  id="StreetP" value="#{inscriptionMB.client.rue_Postal}" />
		<p:watermark for="StreetP" value="Street Address"  />
	
		
		<p:outputLabel value="User:" />
		
		 
	   <p:selectOneMenu  id="UserType" value="#{inscriptionMB.userType}" onchange="ChangeVisibility()" style="width:150px"   >
         	   <f:selectItem itemLabel="User Type" itemValue="" noSelectionOption="true" />
               <f:selectItem itemLabel="Temporary User" itemValue="Temporary" />
               <f:selectItem itemLabel="Permanent User" itemValue="Permanent" />
         </p:selectOneMenu>
      
         
         
        <p:panelGrid columns="1" id="lobjet" style="display:none;" >
      
        <p:selectOneMenu value="#{inscriptionMB.idAbonnement}" style="width:150px">
          <f:selectItem itemLabel="Periods" itemValue="" noSelectionOption="true" />
          <f:selectItems value="#{inscriptionMB.listeAbonnement()}" var="a" itemLabel="#{a.nbrPeriode}#{a.periode}" itemValue="#{a.idStaretegie}" />
        </p:selectOneMenu>
        
        </p:panelGrid>
        <p:inputTextarea id="comments"  />
        <p:watermark for="comments" value="Comments"  />
		
		
		<p:outputLabel value="Contanct Person Info:" />
			
	
	    <p:inputText  id="fName" value="#{inscriptionMB.client.prenom}" />
		<p:watermark for="fName" value="First Name"  />
	
		<p:inputText p:placeholder="Last Name" id="LName" value="#{inscriptionMB.client.nom}" />
		<p:watermark for="LName" value="Last Name"  />
		
		
	   <p:selectOneMenu  id="countryu" value="#{inscriptionMB.idC}" style="width:150px"   >
                <p:ajax listener="#{inscriptionMB.onCountryChange(0)}" update="Stateu" />
                <f:selectItem itemLabel=" Country" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listPays}" var="a" itemValue="#{a.idPays}" itemLabel="#{a.intitule}" />
            </p:selectOneMenu>
            
            
	
	  <p:selectOneMenu id="Stateu" value="#{inscriptionMB.idS}" style="width:150px"  >
               <p:ajax listener="#{inscriptionMB.onStateChange(0)}" update="cityu" />
                 <f:selectItem itemLabel="State" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listeEtat}"  var="s" itemValue="#{s.idEtat}"  itemLabel="#{s.intitule}"/>
            </p:selectOneMenu>
          
            
          
		  <p:selectOneMenu id="cityu" value="#{inscriptionMB.idCi}" style="width:150px"   >
                <f:selectItem itemLabel="City" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listeVille}" var="a" itemValue="#{a.idVille}" itemLabel="#{a.intitule}" />
            </p:selectOneMenu>
               
          
		<p:inputText  id="zipcode" value="#{inscriptionMB.client.codePost_usr}" />
		<p:watermark for="zipcode" value="Zipcode"  />
		
		
		
		<p:inputText  id="Street" value="#{inscriptionMB.client.rue_usr}" />
		<p:watermark for="Street" value="Street Address"  />
		
		
		
		<p:inputText  id="Telephone" value="#{inscriptionMB.client.telephone_usr}" />
		<p:watermark for="Telephone" value="Telephone"  />
		
	
		<p:inputText id="Mobile" value="#{inscriptionMB.client.mobile_usr}" />
		<p:watermark for="Mobile" value="Mobile Number"  />
		
		

		<p:inputText  id="Email" value="#{inscriptionMB.client.email}" />
		<p:watermark for="Email" value="Email"  />
		
		
	
		<p:inputText id="Username" value="#{inscriptionMB.client.username}" />
		<p:watermark for="Username" value="Username"  />
		
		
		<p:inputText  id="Password" value="#{inscriptionMB.client.password}" />
		<p:watermark for="Password" value="Password"  />
		
		<p:inputText p:placeholder="Repeat Password" id="RePassword" value="#{inscriptionMB.passwordRe}"  />
		<p:watermark for="RePassword" value="Repeat Password"  />
		
		 <p:selectOneMenu value="#{inscriptionMB.idLangue}" >
		  <f:selectItem itemLabel="Language" itemValue="" noSelectionOption="true" />
           <f:selectItems value="#{inscriptionMB.listeLangauge()}" var="a" itemLabel="#{a.intitule}" itemValue="#{a.id}" />    
		 </p:selectOneMenu> 
		  
		<p:outputLabel  value="I confirm that... " />
       <h:panelGrid columns="2" cellpadding="5" style="clear: both;margin: auto;" > 
       <p:selectBooleanCheckbox value="#{inscriptionMB.terme1}" /><h:link style="color:blue;" hreflang="#">I have read  The user terms </h:link>
       <p:selectBooleanCheckbox value="#{inscriptionMB.terme2}" /><h:link style="color:blue;" hreflang="#">I have read  The price list </h:link>
        <p:selectBooleanCheckbox value="#{inscriptionMB.terme3}" /> <h:link style="color:blue;" hreflang="#"> It is my responsibility that those users who operate on my behalf, obey  The user terms </h:link>
           </h:panelGrid>  
           <div class="cap1">
         <p:captcha label="Captcha" id="captcha1" /></div>
            <div class="term1"></div>
        <p:commandButton ajax="false" value="Register" action="#{inscriptionMB.AjouterFrontEnd('Tra','Pro')}" />

        </h:panelGrid>
         </h:form>
    </p:panel>
   
</div>



</ui:define>
</ui:composition>
